<?php
  class buffer extends error{   protected $lang=array();
   function __construct($filename=""){    $this->path['path']=SITE_URL;
    $this->path['admin_dir_full']=ADMIN_DIR_FULL;   	if(file_exists($filename)){
    $this->buffer.=join(" ",file(SITE_DIR.$filename));
    }
   }


 	function view($filename, $arr,$arg=false){
 	 if(file_exists($filename) ) {      if(empty($arr))$arr=array();      extract($arr+$this->path+$this->lang);
      if($arg !=1){        include (SITE_DIR.$filename);
        return;
       }else{        ob_start();                    // Start output buffering
        include(SITE_DIR.$filename);                // Include the file
        $contents = ob_get_contents(); // Get the contents of the buffer
        ob_end_clean();                // End buffering and discard
        return $contents;
       }
 	  }else{ 	 	$this->show_error("buffer",$filename);
 	  }
 	}

    function set_lang($lang){     $this->lang=$lang;
    }





 }
?>